package com.wang.springframework.beans.factory.config;

import com.wang.springframework.beans.BeansException;
import com.wang.springframework.beans.factory.BeanFactory;

/**
 * @author wangjianhua
 *  interface to be implemented by bean factories that are capable of
 *  autowiring, provided that they want to expose this functionality for
 *  existing bean instances.
 * @date 2021/8/24/024 18:16
 **/
public interface AutowireCapableBeanFactory extends BeanFactory {


    /**
     * 执行 BeanPostProcessors 接口实现类的postProcessBeforeInitialization方法
     * @param existingBean existingBean
     * @param beanName beanName
     * @return Object
     * @throws BeansException 异常
     */
    Object applyBeanPostProcessorsBeforeInitialization(Object existingBean,String beanName) throws BeansException;

    /**
     * 执行 BeanPostProcessors 接口实现类的postProcessAfterInitialization方法
     * @param existingBean existingBean
     * @param beanName beanName
     * @return Object
     * @throws BeansException 异常
     */
    Object applyBeanPostProcessorsAfterInitialization(Object existingBean,String beanName) throws BeansException;


}
